package com.java2007.hotel.service;

import com.java2007.hotel.entity.PageBean;
import com.java2007.hotel.pojo.Food;

import java.sql.SQLException;
import java.util.List;

/**
 * @author Reckeys
 * @version V1.0
 * @date 2021/01/23
 **/
public interface FoodService {
    /**
     * 通过菜名模糊查询
     * @param foodName
     * @return
     */
    List<Food> findByFoodName(String foodName) throws SQLException;

    /**
     * 通过foodId删除
     * @param foodId
     * @return
     */
    int deleteByFoodId(Integer foodId) throws SQLException;

    /**
     * 通过id查询信息
     * @param foodId
     * @return
     */
    Food findByfoodId(Integer foodId) throws SQLException;

    /**
     * 添加菜
     * @param food
     * @return
     */
    int addFood(Food food) throws SQLException;

    /**
     * 修改food信息
     * @param food
     * @return
     */
    int updateFood(Food food);

    /**
     * 分页查询菜的信息
     * @param pageNo 页数
     * @param pageSize 每页显示的数量
     * @param food
     * @return
     */
    PageBean<Food> findFoodToPage(Integer pageNo, Integer pageSize, Food food) throws SQLException;

    /**
     * 按照菜名查询
     * @param foodName
     * @return
     */
    Food findFood(String foodName) throws SQLException;
}
